import { GTextFormat } from "../../../../common/GTextFormat";
import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
//class BournTooltip
    
    export  class BournTooltip /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._bournImgArr = [];
            return;
        }

        public set data(arg1: Array<any>)
        {
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=0;
            var loc6=null;
            this.dispose();
            if (arg1.length <= 0 || arg1 == null) 
            {
                return;
            }
            var loc1=arg1[0] as Array<any>;
            this._bournArr = arg1[1] as Array<any>;
            this._bournImgArr.splice(0);
            var loc7=0;
            while (loc7 < loc1.length) 
            {
                loc2 = new Object /* flash.text.TextField */();
                loc2.defaultTextFormat = new GTextFormat("", null, null, null, null, null, null, null, null, null, null, null, 3);
                loc2.autoSize = flash.text.TextFieldAutoSize.LEFT;
                loc2.multiline = true;
                loc2.htmlText = loc1[loc7];
                loc2.y = loc4;
                addChild(loc2);
                if (loc7 < (loc1.length - 1)) 
                {
                    loc3 = ObjCreate.createBg(10, loc4 + loc2.textHeight, 180, 1, this, ImagesConst.SeptalLine);
                    loc5 = this._bournArr[loc7];
                    (loc6 = new Object /* flash.display.Bitmap */()).x = 170;
                    loc6.y = loc2.y - 3;
                    addChild(loc6);
                    this._bournImgArr.push(loc6);
                }
                loc4 = loc4 + loc2.textHeight + 10;
                ++loc7;
            }
            LoaderHelp.addResCallBack(ResFileConst.breakThrough, this.onResLoaded);
            return;
        }

        protected onResLoaded(): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=null;
            var loc4=loc4 = 0;
            while (loc4 < this._bournArr.length) 
            {
                loc2 = this._bournArr[loc4];
                loc1 = this._bournImgArr[loc4] as Object /* flash.display.Bitmap */;
                loc3 = GlobalClass.getBitmapData("BreakThrough_" + loc2);
                if (loc3) 
                {
                    loc1.bitmapData = loc3;
                }
                ++loc4;
            }
            return;
        }

        public dispose(): void
        {
            while (this.numChildren) 
            {
                removeChildAt(0);
            }
            return;
        }

        protected /* var */_bournImgArr: Array<any>;

        protected /* var */_bournArr: Array<any>;
    }
